package com.info.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import com.info.model.UserModel;
import com.info.service.UserService;

@Controller
@RequestMapping(value = "/")
public class IndexController {
	
	@Autowired
    UserService userService;
    
    @RequestMapping(value = "/getUser")
    public String getUser(ModelMap map) {
    	List<UserModel> users = userService.getAllUsers();
    	map.addAttribute("users", users);
        return "getuser";
    }
}
